// user/my-teacher2/my-teacher2.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navState: 0,
    list_object:null,
    User_id:"",
    list:[],
    list2_object:null,
    currentTab: 0,
    list_two:[],
  },
  swichNav: function (e) {
    console.log(this.data.user_id)
    getApp().request({
      url:  getApp().api.schoolclass.next_recommend,
      data: {
        next_user_id:this.data.user_id
      },
      
      success: (result) => {
        console.log(result)
        this.setData({
          list_object:result.data.user_list.length,
          list:result.data.user_list,
          User_id:this.data.user_id,

        })
      },
      fail: (res) => {},
      complete: (res) => {},
    })
    },
    
  tap:function(t){
    getApp().request({
      url: getApp().api.schoolclass.second_recommend,
      success: (result) => {
        console.log(result.data.user_list)
        this.setData({
          list2_object:result.data.user_list.length,
          list:result.data.user_list,
          User_id:t.user_id
        })
      },
    })
 

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (t) {
    console.log(this)
    this.data.user_id=t.user_id;//赋值
    getApp().page.onLoad(this, t);
    if (this.data.store.is_shenhe == 0) {
      wx.setNavigationBarTitle({
        title: '我的教师'
      })
    }
    console.log(t);
      var User_id=t.user_id;
      getApp().request({
        url:  getApp().api.schoolclass.next_recommend,
        data: {
          next_user_id:User_id
        },
        
        success: (result) => {
          console.log(result)
          this.setData({
            list_object:result.data.user_list.length,
            list:result.data.user_list,
            User_id:t.user_id,

          })
        },
        fail: (res) => {},
        complete: (res) => {},
      })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})